package com.gray.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gray.pojo.Section;
import com.gray.service.impl.SectionServiceImpl;

@Controller
@RequestMapping(value="/front")
public class FrontController {

	@Autowired
	private SectionServiceImpl sectionServiceImpl;
	
	/**
	 * 获取所有版块信息
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value="getallsection")
	public Map getAllSection(){
		Map map = new HashMap();
		List<Section> list  = sectionServiceImpl.getAllSection();
		if(list!=null){
			map.put("section", list);
			map.put("sucess", true);
		}else{
			map.put("sucess", false);
		}
		return map;
	}
}
